package com.deyuanyun.pic.ctrl.controller.vo.exinsp;

import com.deyuanyun.pic.common.util.format.DateFormat;
import com.deyuanyun.pic.ctrl.domain.ExinspCpjumper;
import com.deyuanyun.pic.ctrl.enumeration.AbnormalEnum;
import com.deyuanyun.pic.pipe.controller.vo.BaseVOUtil;
import com.deyuanyun.pic.settings.support.biz.PipeLineUtil;
import com.github.pagehelper.Page;

/**
 * 跨接线检测记录表
 */
public class ExinspCpjumperVO extends ExinspBaseVO<ExinspCpjumper> {

    // 所属管道
    private String pipeLineName;
    // 设备编号(自定义编号)
    private String customNumber;
    // 测试桩编号
    private String testStationNum;
    // 跨接线连通时电位（mV）
    public Long crosswireConnecttion;
    // 跨接线断开后电位（mV）1
    public Long crosswireDisConnection1;
    // 连接管道名称1
    private String connectingPipeName1;
    // 跨接线断开后电位（mV）2
    public Long crosswireDisConnection2;
    // 连接管道名称2
    private String connectingPipeName2;
    // 跨接线断开后电位（mV）3
    public Long crosswireDisConnection3;
    //连接管道名称3
    private String connectingPipeName3;
    // 跨接线焊点检查
    private String solderJointInspection;
    // 异常记录
    private String faultRecord;
    // 是否有异常(YES、NO)
    private String abnormal;
    // 处理措施
    private String treatmentMeasures;
    // 检测日期
    private String detectiongDete;

    public String getPipeLineName() {
        return pipeLineName;
    }

    public void setPipeLineName(String pipeLineName) {
        this.pipeLineName = pipeLineName;
    }

    public String getCustomNumber() {
        return customNumber;
    }

    public void setCustomNumber(String customNumber) {
        this.customNumber = customNumber;
    }

    public String getTestStationNum() {
        return testStationNum;
    }

    public void setTestStationNum(String testStationNum) {
        this.testStationNum = testStationNum;
    }

    public Long getCrosswireConnecttion() {
        return crosswireConnecttion;
    }

    public void setCrosswireConnecttion(Long crosswireConnecttion) {
        this.crosswireConnecttion = crosswireConnecttion;
    }

    public Long getCrosswireDisConnection1() {
        return crosswireDisConnection1;
    }

    public void setCrosswireDisConnection1(Long crosswireDisConnection1) {
        this.crosswireDisConnection1 = crosswireDisConnection1;
    }

    public String getConnectingPipeName1() {
        return connectingPipeName1;
    }

    public void setConnectingPipeName1(String connectingPipeName1) {
        this.connectingPipeName1 = connectingPipeName1;
    }

    public Long getCrosswireDisConnection2() {
        return crosswireDisConnection2;
    }

    public void setCrosswireDisConnection2(Long crosswireDisConnection2) {
        this.crosswireDisConnection2 = crosswireDisConnection2;
    }

    public String getConnectingPipeName2() {
        return connectingPipeName2;
    }

    public void setConnectingPipeName2(String connectingPipeName2) {
        this.connectingPipeName2 = connectingPipeName2;
    }

    public Long getCrosswireDisConnection3() {
        return crosswireDisConnection3;
    }

    public void setCrosswireDisConnection3(Long crosswireDisConnection3) {
        this.crosswireDisConnection3 = crosswireDisConnection3;
    }

    public String getConnectingPipeName3() {
        return connectingPipeName3;
    }

    public void setConnectingPipeName3(String connectingPipeName3) {
        this.connectingPipeName3 = connectingPipeName3;
    }

    public String getSolderJointInspection() {
        return solderJointInspection;
    }

    public void setSolderJointInspection(String solderJointInspection) {
        this.solderJointInspection = solderJointInspection;
    }

    public String getFaultRecord() {
        return faultRecord;
    }

    public void setFaultRecord(String faultRecord) {
        this.faultRecord = faultRecord;
    }

    public String getAbnormal() {
        return abnormal;
    }

    public void setAbnormal(String abnormal) {
        this.abnormal = abnormal;
    }

    public String getTreatmentMeasures() {
        return treatmentMeasures;
    }

    public void setTreatmentMeasures(String treatmentMeasures) {
        this.treatmentMeasures = treatmentMeasures;
    }

    public String getDetectiongDete() {
        return detectiongDete;
    }

    public void setDetectiongDete(String detectiongDete) {
        this.detectiongDete = detectiongDete;
    }

    public void fromDomain(ExinspCpjumper domain) {

        // 所属管道
        this.pipeLineName = PipeLineUtil.getPipeLineName(domain.getPipeLineId());
        // 设备编号(自定义编号)
        this.customNumber = domain.getCustomNumber();
        // 测试桩编号
        this.testStationNum = domain.getTestStationId();
        // 跨接线连通时电位（mV）
        this.crosswireConnecttion = domain.getCrosswireConnecttion();
        // 跨接线断开后电位（mV）1
        this.crosswireDisConnection1 = domain.getCrosswireDisConnection1();
        // 连接管道名称1
        this.connectingPipeName1 = domain.getConnectingPipeName1();
        // 跨接线断开后电位（mV）2
        this.crosswireDisConnection2 = domain.getCrosswireDisConnection2();
        // 连接管道名称2
        this.connectingPipeName2 = domain.getConnectingPipeName2();
        // 跨接线断开后电位（mV）3
        this.crosswireDisConnection3 = domain.getCrosswireDisConnection3();
        //连接管道名称3
        this.connectingPipeName3 = domain.getConnectingPipeName3();
        // 跨接线焊点检查
        this.solderJointInspection = domain.getSolderJointInspection();
        // 异常记录
        this.faultRecord = domain.getFaultRecord();
        // 是否有异常
        this.abnormal = AbnormalEnum.getLabel(domain.getAbnormal());
        // 处理措施
        this.treatmentMeasures = domain.getUpdateRemark();;
        // 检测日期
        this.detectiongDete = DateFormat.format(domain.getDetectiongDete());

        super.fromDomain(domain.getId(), domain.getRecorder(), domain.getRecordTime(), domain.getRemarks());
    }

    public Page<ExinspCpjumperVO> fromDomainList(Page<ExinspCpjumper> domainList) {

        Page<ExinspCpjumperVO> list = new Page<ExinspCpjumperVO>();
        for (ExinspCpjumper exinspCpjumper : domainList) {
            ExinspCpjumperVO exinspCpjumperVO = new ExinspCpjumperVO();
            exinspCpjumperVO.fromDomain(exinspCpjumper);
            list.add(exinspCpjumperVO);
        }
        BaseVOUtil.converterPage(domainList, list);
        return list;
    }
}